/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 2:10 PM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.*
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.SellTrades
import java.util.*

class SellTrade(DataContext: IDataContext) : ITrade, BaseEntity(DataContext, SellTrades) {
    var applicationDomainID by SellTrades.ApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(SellTrades.ApplicationDomainID) { IMSApplicationDomain(it) }
    var weID by SellTrades.WeID
    override var we: IOrgan by hasOne(SellTrades.WeID) { Organ(it) }
    var theyID by SellTrades.TheyID
    override var they: IOrgan by hasOne(SellTrades.TheyID) { Organ(it) }
    override var products: Collection<IProduct> = LinkedList()
    var priceTableID by SellTrades.PriceTableID
    override var price: IPriceTable by hasOne(SellTrades.PriceTableID) { PriceTable(it) }
    override var state: Int by SellTrades.State
    var areaID by SellTrades.AreaID
    override var area: IArea by hasOne(SellTrades.AreaID) { Area(it) }
    var orderID by SellTrades.OrderID
    override var order: IOrder? = null
    override var tradeItems: Collection<ITradeItem> = LinkedList()
}